#pragma once
#include <cmath>
#include "fftwindow.h"
#define PI 3.1415926535898
class FFTWindow_cos2 :
	public FFTWindow
{
private:
	double p_b, p_e;
public:
	virtual double Filter(double x){
		//counter++;
		if(counter/(double)win_width<p_b){
			double scaler=cos(PI/2*(1+counter++/(p_b  * win_width ) ) );
			return x*scaler*scaler;
		}else if((win_width-counter)/(double)win_width<p_e){
			double scaler=cos(PI/2*(counter++/(p_b  * win_width ) ) );
			return x*scaler*scaler;
		}else{
			return x;
			counter++;
		}
		
	}
	FFTWindow_cos2(unsigned int w, double b, double e):FFTWindow(w),p_b(b),p_e(e)
	{
		//counter++;
	}

	~FFTWindow_cos2(void)
	{
	}
};
